const path = require('path')
const rootPath = path.join(__dirname, '..', 'datas')

function pathJoin() {
  if (!arguments) return rootPath
  const len = arguments.length
  const array = [rootPath]
  for (let i = 0; i < len; i++) {
    let value = arguments[i] || ''
    if (typeof value !== 'string') {
      value = ''
    }
    array.push(value)
  }
  const result = path.resolve(array.join('/'))
  return result
}

module.exports = pathJoin